<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>

</head>
<body>
    <div ng-app="myApp" ng-controller="myCtrl">
        名：<input type="text" ng-model="firstName"><br>
        姓:<input type="text" ng-model="lastName"><br>
        姓名：{{firstName+" "+lastName}}
    </div>
</body>
<script>
    var app = angular.module('myApp',[]);
    app.controller('myCtrl',function($scope,$http){

        $http({
            method:"get",
            url:"http://172.20.8.26:8080/user/userinfo"
        }).then(function successCallback(response) {
            alert("success");
            console.log(response)
            var data = response.data;
            var user = JSON.parse(data).user;
            console.log(JSON.parse(data).user);
            $scope.firstName = user.id;
            $scope.lastName = user.name;
        }, function errorCallback(response) {
            alert("failed");
            console.log(response)
        });
    })
</script>
</html>